<?php
/**
 * Created by PhpStorm.
 * User: hwy
 * Date: 2020/6/21
 * Time: 17:23
 */

namespace App\Http\Middleware;

use Illuminate\Cookie\Middleware\EncryptCookies as Middleware;
use Closure;

class AuthStocks extends Middleware
{

    public function handle($request, Closure $next){

        //如果没有登录;则重定向到登录页面
        session_start();
//        dd(session('stocks_key'));
        if (!session('stocks_key')) {
            return redirect()->route('user.stocks_login');
        }


        return $next($request);
    }
}